"""
RAG管理路由
"""

from typing import List

from fastapi import APIRouter
from pydantic import BaseModel

router = APIRouter()


class RAGResponse(BaseModel):
    id: int
    name: str
    description: str
    status: str


@router.get("/", response_model=List[RAGResponse])
async def get_rag_modules():
    """获取RAG模块列表"""
    return [
        {
            "id": 1,
            "name": "文档检索模块",
            "description": "基于向量数据库的文档检索",
            "status": "active"
        }
    ]


@router.post("/{rag_id}/rebuild")
async def rebuild_rag_index(rag_id: int):
    """重建RAG索引"""
    return {"message": f"RAG模块 {rag_id} 索引重建完成"}
